//package 网络编程.TCPECHOBITE;
//
//import java.io.IOException;
//import java.io.InputStream;
//import java.io.OutputStream;
//import java.io.PrintWriter;
//import java.net.Socket;
//import java.util.Scanner;
//
//
//
//public class TCPEchoClint {
//    //客户端利用socket
//    private Socket socket = null;
//
//    public TCPEchoClint() throws IOException {
//        socket = new Socket("127.0.0.1",8000);
//    }
//    public void start() throws IOException {
//        System.out.println("客户端启动");
//        Scanner scanNet = new Scanner(System.in);
//        try(InputStream inputStream = socket.getInputStream();
//            OutputStream outputStream = socket.getOutputStream()){
//            Scanner scan = new Scanner(inputStream);
//            PrintWriter printWriter = new PrintWriter(outputStream);
//            while(true){
//                System.out.print(">");
//                //客户端输入请求给服务器发送
//                String request = scanNet.next();//发送hello,server
//                //发送给服务器
//                printWriter.println(request);
//                printWriter.flush();
//                //读取响应
//                String response = scan.next();
//                System.out.printf("req = %s; rep = %s\n",request,response);
//            }
//        }finally {
//            socket.close();
//        }
//    }
//
//    public static void main(String[] args) throws IOException {
//        TCPEchoClint tcpEchoClint = new TCPEchoClint();
//        tcpEchoClint.start();
//    }
//
//}
